package ManageGameHServer.code;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpContentCompressor;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;

public class HttpServerHandler  extends ChannelInitializer<SocketChannel> {
    @Override
    protected  void initChannel(SocketChannel ch)  throws Exception{
        ch.pipeline().addLast(new HttpResponseEncoder());
        ch.pipeline().addLast(new HttpRequestDecoder());
        ch.pipeline().addLast(new HttpObjectAggregator(1048576));
        ch.pipeline().addLast(new HttpContentCompressor());
        ch.pipeline().addLast(new HttpServerHandlerWorker());
    }
}
